home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  5.4 KB  |  257 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Contains:    Definition of AIFF file format components.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __AIFF__
  21. #define __AIFF__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41.  
  42. enum {
  43.     AIFFID                        = 'AIFF',
  44.     AIFCID                        = 'AIFC',
  45.     FormatVersionID                = 'FVER',
  46.     CommonID                    = 'COMM',
  47.     FORMID                        = 'FORM',
  48.     SoundDataID                    = 'SSND',
  49.     MarkerID                    = 'MARK',
  50.     InstrumentID                = 'INST',
  51.     MIDIDataID                    = 'MIDI',
  52.     AudioRecordingID            = 'AESD',
  53.     ApplicationSpecificID        = 'APPL',
  54.     CommentID                    = 'COMT',
  55.     NameID                        = 'NAME',
  56.     AuthorID                    = 'AUTH',
  57.     CopyrightID                    = '(c) ',
  58.     AnnotationID                = 'ANNO'
  59. };
  60.  
  61. enum {
  62.     NoLooping                    = 0,
  63.     ForwardLooping                = 1,
  64.     ForwardBackwardLooping        = 2,
  65. /* AIFF-C Versions */
  66.     AIFCVersion1                = 0xA2805140L
  67. };
  68.  
  69. /* Compression Names */
  70. #define NoneName "\pnot compressed"
  71. #define ACE2to1Name "\pACE 2-to-1"
  72. #define ACE8to3Name "\pACE 8-to-3"
  73. #define MACE3to1Name "\pMACE 3-to-1"
  74. #define MACE6to1Name "\pMACE 6-to-1"
  75.  
  76. enum {
  77. /* Compression Types */
  78.     NoneType                    = 'NONE',
  79.     ACE2Type                    = 'ACE2',
  80.     ACE8Type                    = 'ACE8',
  81.     MACE3Type                    = 'MAC3',
  82.     MACE6Type                    = 'MAC6'
  83. };
  84.  
  85. typedef unsigned long ID;
  86.  
  87. typedef short MarkerIdType;
  88.  
  89. struct ChunkHeader {
  90.     ID                                ckID;
  91.     long                            ckSize;
  92. };
  93. typedef struct ChunkHeader ChunkHeader;
  94.  
  95. struct ContainerChunk {
  96.     ID                                ckID;
  97.     long                            ckSize;
  98.     ID                                formType;
  99. };
  100. typedef struct ContainerChunk ContainerChunk;
  101.  
  102. struct FormatVersionChunk {
  103.     ID                                ckID;
  104.     long                            ckSize;
  105.     unsigned long                    timestamp;
  106. };
  107. typedef struct FormatVersionChunk FormatVersionChunk;
  108.  
  109. typedef FormatVersionChunk *FormatVersionChunkPtr;
  110.  
  111. struct CommonChunk {
  112.     ID                                ckID;
  113.     long                            ckSize;
  114.     short                            numChannels;
  115.     unsigned long                    numSampleFrames;
  116.     short                            sampleSize;
  117.     extended80                        sampleRate;
  118. };
  119. typedef struct CommonChunk CommonChunk;
  120.  
  121. typedef CommonChunk *CommonChunkPtr;
  122.  
  123. struct ExtCommonChunk {
  124.     ID                                ckID;
  125.     long                            ckSize;
  126.     short                            numChannels;
  127.     unsigned long                    numSampleFrames;
  128.     short                            sampleSize;
  129.     extended80                        sampleRate;
  130.     ID                                compressionType;
  131.     char                            compressionName[1];            /* variable length array, Pascal string */
  132. };
  133. typedef struct ExtCommonChunk ExtCommonChunk;
  134.  
  135. typedef ExtCommonChunk *ExtCommonChunkPtr;
  136.  
  137. struct SoundDataChunk {
  138.     ID                                ckID;
  139.     long                            ckSize;
  140.     unsigned long                    offset;
  141.     unsigned long                    blockSize;
  142. };
  143. typedef struct SoundDataChunk SoundDataChunk;
  144.  
  145. typedef SoundDataChunk *SoundDataChunkPtr;
  146.  
  147. struct Marker {
  148.     MarkerIdType                    id;
  149.     unsigned long                    position;
  150.     Str255                            markerName;
  151. };
  152. typedef struct Marker Marker;
  153.  
  154. struct MarkerChunk {
  155.     ID                                ckID;
  156.     long                            ckSize;
  157.     unsigned short                    numMarkers;
  158.     Marker                            Markers[1];                    /* variable length array */
  159. };
  160. typedef struct MarkerChunk MarkerChunk;
  161.  
  162. typedef MarkerChunk *MarkerChunkPtr;
  163.  
  164. struct AIFFLoop {
  165.     short                            playMode;
  166.     MarkerIdType                    beginLoop;
  167.     MarkerIdType                    endLoop;
  168. };
  169. typedef struct AIFFLoop AIFFLoop;
  170.  
  171. struct InstrumentChunk {
  172.     ID                                ckID;
  173.     long                            ckSize;
  174.     UInt8                            baseFrequency;
  175.     UInt8                            detune;
  176.     UInt8                            lowFrequency;
  177.     UInt8                            highFrequency;
  178.     UInt8                            lowVelocity;
  179.     UInt8                            highVelocity;
  180.     short                            gain;
  181.     AIFFLoop                        sustainLoop;
  182.     AIFFLoop                        releaseLoop;
  183. };
  184. typedef struct InstrumentChunk InstrumentChunk;
  185.  
  186. typedef InstrumentChunk *InstrumentChunkPtr;
  187.  
  188. struct MIDIDataChunk {
  189.     ID                                ckID;
  190.     long                            ckSize;
  191.     UInt8                            MIDIdata[1];                /* variable length array */
  192. };
  193. typedef struct MIDIDataChunk MIDIDataChunk;
  194.  
  195. typedef MIDIDataChunk *MIDIDataChunkPtr;
  196.  
  197. struct AudioRecordingChunk {
  198.     ID                                ckID;
  199.     long                            ckSize;
  200.     UInt8                            AESChannelStatus[24];
  201. };
  202. typedef struct AudioRecordingChunk AudioRecordingChunk;
  203.  
  204. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  205.  
  206. struct ApplicationSpecificChunk {
  207.     ID                                ckID;
  208.     long                            ckSize;
  209.     OSType                            applicationSignature;
  210.     UInt8                            data[1];                    /* variable length array */
  211. };
  212. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  213.  
  214. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  215.  
  216. struct Comment {
  217.     unsigned long                    timeStamp;
  218.     MarkerIdType                    marker;
  219.     unsigned short                    count;
  220.     char                            text[1];                    /* variable length array, Pascal string */
  221. };
  222. typedef struct Comment Comment;
  223.  
  224. struct CommentsChunk {
  225.     ID                                ckID;
  226.     long                            ckSize;
  227.     unsigned short                    numComments;
  228.     Comment                            comments[1];                /* variable length array */
  229. };
  230. typedef struct CommentsChunk CommentsChunk;
  231.  
  232. typedef CommentsChunk *CommentsChunkPtr;
  233.  
  234. struct TextChunk {
  235.     ID                                ckID;
  236.     long                            ckSize;
  237.     char                            text[1];                    /* variable length array, Pascal string */
  238. };
  239. typedef struct TextChunk TextChunk;
  240.  
  241. typedef TextChunk *TextChunkPtr;
  242.  
  243.  
  244. #if PRAGMA_IMPORT_SUPPORTED
  245. #pragma import off
  246. #endif
  247.  
  248. #if PRAGMA_ALIGN_SUPPORTED
  249. #pragma options align=reset
  250. #endif
  251.  
  252. #ifdef __cplusplus
  253. }
  254. #endif
  255.  
  256. #endif /* __AIFF__ */
  257.